﻿<%@ Page language="c#" Inherits="Mysoft.Crm.Application.Pages.Tools.ViewEditor.Dialogs.SetSort" CodeBehind="Mysoft.Crm.Application.Pages.Tools.dll" %>
<html>
<head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312"/>
<title>配置排序</title>
<link rel="stylesheet" type="text/css" href="/_common/styles/global.css">
<link rel="stylesheet" type="text/css" href="/_common/styles/select.css">
<link rel="stylesheet" type="text/css" href="/_common/styles/dialogs.css">

<script language="javascript" src="/_common/scripts/global.js"></script>

<script language="javascript">

	function window.onload()
	{
		var oNodes = window.dialogArguments.oGridXml.selectNodes("//row/cell");		
		var sHTML = "<span changeHandler='updateUI' name='sortCol' class='selectBox' value='" + window.dialogArguments.sSortCol + "'><table cellspacing='0' cellpadding='2' style='display: none;'>";
		var iLen = oNodes.length;

		for (var i=0; i < iLen; i++)
		{
			sHTML += "<tr><td val='" + oNodes[i].getAttribute("name") + "'>" + oNodes[i].getAttribute("desc") + "</td></tr>"
		}

		sortColumn.innerHTML = sHTML + "</table></span>";
	}

	function Ok()
	{
		window.returnValue = new Array(rdDescend.checked, sortCol.returnValue);
		window.close();
	}

	function updateUI()
	{
		btnDialogOk.disabled = false;
	}

</script>
</head>
<body>

	<table border="0" cellspacing="0" cellpadding="8" width="100%" height="100%">
		<tr>
			<td class="header">
				<div class="header">配置排序</div>
				<div class="headerdesc">选择一列作为默认排序列。</div>
			</td>
		</tr>
		<tr>
			<td class="main">
				<table cellpadding="0" cellspacing="5" width="100%" style="table-layout: fixed;">
					<col width="75"><col>
					<tr height="25">
						<td>列名：</td>
						<td id="sortColumn"></td>
					</tr>
					<tr>
						<td valign="top">顺序：</td>
						<td>
							<table width="100%" cellspacing="0" cellpaddig="6">
							<col width="20"><col>
								<tr>
									<td><input type="radio" onclick="updateUI();" class="radio" name="rdDir" id="rdAscend" <%if (_descend == "false") { Response.Write ( "checked"); } %>></td>
									<td><label for="rdAscend">升序</label></td>
								</tr>
								<tr>
									<td><input type="radio" onclick="updateUI();" class="radio" name="rdDir" id="rdDescend" <%if (_descend == "true") { Response.Write ( "checked"); } %>></td>
									<td><label for="rdDescend">降序</label></td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td class="buttons">
				<button id="btnDialogOk" onclick="Ok();" disabled>确定</button>
				&nbsp;
				<button onclick="window.close();">取消</button>
			</td>
		</tr>
	</table>

</body>
</html>
